#ifndef IVICONHANDLER_H
#define IVICONHANDLER_H
#include "ViconFrame.h"

#define RESULT_OK 0
#define RESULT_CONNECTION_FAILED 1
#define RESULT_NOT_CONNECTED 2
#define RESULT_NODATA 3
#define RESULT_NOBODIES 4
#define RESULT_NULLPOINTER 5

class iViconHandler abstract{
private:

public:

	virtual int Initialise() = 0;
	virtual int TrackBody(const char* _skel, const char* _bone) = 0;
	virtual int Connect(const char* _address, int _port) = 0;
	virtual int GetFrame(ViconFrame* _frame) = 0;
	virtual int GetHardwareFPS() = 0;
	virtual int GetLastNetworkError() = 0;
	virtual int Release() = 0;

};

#ifndef _VICONDLL // Exclude this fragment of code when
#ifndef _VICONLIB // compiling the library itself


#ifdef _VICONLIB_STATIC
extern iViconHandler* CreateViconHandler();
#else
#include <windows.h>
typedef void* (*pvFunctv)();
iViconHandler* CreateViconHandler() {
	HINSTANCE hDLL = NULL;
	hDLL = LoadLibraryA("ViconLib");

	pvFunctv pConstr = NULL;
	pConstr = (pvFunctv)GetProcAddress(hDLL, "CreateViconHandler");
	
	if (pConstr)
		return (iViconHandler*) pConstr();
	
	return NULL;
}
#endif // _VICONLIB_STATIC


#endif // _VICONLIB
#endif // _VICONDLL

#endif